package com.tutorialspoint;

import java.net.SocketTimeoutException;
import java.sql.SQLException;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import channel.UCSAPIService;

@Controller
public class HelloController
{
	
	@RequestMapping(value="Front")
   public String printHello(@ModelAttribute("info") Info info,BindingResult result,Model model) throws SocketTimeoutException, Exception 
   {
		String host=info.getHostname();
		int port=Integer.parseInt(info.getPort());
		String user=info.getUsername();
		String pass=info.getPassword();
		boolean issecure=true;
		UCSAPIService ucs=new UCSAPIService(host, user, pass, port, issecure);
		ucs.toLoginRequest();
		ucs.toConfigResolve();
		return "Front";
   }
   
   @RequestMapping("side_bar")
   public String sideHello(ModelMap model) throws ClassNotFoundException, SQLException 
   {
	  
      return "side_bar";
   }

   @RequestMapping("Title")
   public String TitleHello(ModelMap model) throws ClassNotFoundException, SQLException 
   {
	  
      return "Title";
   }
   
   @RequestMapping("blank")
   public String blankHello(ModelMap model) throws ClassNotFoundException, SQLException 
   {
	  
      return "blank";
   }
   
   @RequestMapping("New_Front")
   public String chassisHello(ModelMap model) throws ClassNotFoundException, SQLException 
   {
	  
      return "New_Front";
   }
   
   
   @RequestMapping("FanModule")
   public String fanHello(ModelMap model) throws ClassNotFoundException, SQLException 
   {
	  
      return "FanModule";
   }
   
   
   @RequestMapping("BladeServer")
   public String bladeHello(ModelMap model) throws ClassNotFoundException, SQLException 
   {
	  
      return "BladeServer";
   }
   
   @RequestMapping("FabricIC")
   public String fabricHello(ModelMap model) throws ClassNotFoundException, SQLException 
   {
	  
      return "FabricIC";
   }
   
   @RequestMapping("PSU")
   public String psuHello(ModelMap model) throws ClassNotFoundException, SQLException 
   {
	  
      return "PSU";
   }
   
   @RequestMapping("/ServiceProfile")
   public String serviceProfile(ModelMap model)throws ClassNotFoundException,SQLException
   {
	   return "ServiceProfile";
   }
   
   
}